import { http } from "@/utils/http";
import baseUrlProxy from "@/api/baseUrlProxy";

export const uploadVppFile = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlProxy + "/api/annex/up",
    {
      data: data
    },
    {
      headers: {
        "content-type": "multipart/form-data"
      }
    }
  );
};
export const getVppFile = (params?: object) => {
  return http.request<any>("get", baseUrlProxy + "/api/annex", {
    params: params
  });
};
export const delVppFile = id => {
  return http.request<any>("post", baseUrlProxy + "/api/annex/del/" + id);
};
export const previewVppFile = (params?: object) => {
  return http.request<any>(
    "post",
    baseUrlProxy + "/api/annex/preview",
    {
      data: params
    }
    // { responseType: "blob" }
  );
};
export const downVppFile = id => {
  return http.request<any>(
    "post",
    baseUrlProxy + "/api/annex/down/" + id,
    {},
    { responseType: "blob" }
  );
};
